<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			var userChoice = window.confirm("请选择“确定”或取消");
			if (userChoice == true) {
				document.write('OK!')
			}
			if (userChoice == false) {
				document.write('Cancel!')
			}
			
			// else
			var x = 10;
			
			if (x >= 0) {
				y = 6 * x;
			} else {
				y = 1 - x;
			}
			console.log(y)
			
			// switch 语句
			const expr = 'Papayas';
			switch (expr) {
			  case 'Oranges':
			    console.log('Oranges are $0.59 a pound.');
			    break;
			  case 'Mangoes':
			  case 'Papayas':
			    console.log('Mangoes and papayas are $2.79 a pound.');
			    // Expected output: "Mangoes and papayas are $2.79 a pound."
			    break;
			  default:
			    console.log(`Sorry, we are out of ${expr}.`);
			}
		</script>
	</body>
</html>